<?php

class BufferedView extends View {

	private $buffer;

	function __construct($viewName, $vars=null) {
		ob_start();
		parent::__construct($viewName, $vars);
		$this->buffer = ob_get_contents();
		ob_end_clean();
	}

	static function instance($viewName, $vars=null) {
		return new self($viewName, $vars);
	}
	
	function getBuffer() {
		return $this->buffer;
	}
	
}